package com.java.yz.day14.SellTickets;

public class Windows extends Thread{
    static int ticket =100;

    @Override
    public void run() {
        while (true){
            if (ticket>0){
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println(getName()+"窗口正在卖 第"+(ticket--)+"张票");
            }

        }
    }
}
